(\leftarrow) Suppose Y is compact, and \mathscr{A} = \{A_\alpha\}_{\alpha \in I} is a cover of Y by sets open in X. Then the collection
\{A_\alpha \cap Y \mid \alpha \in I\}
is a cover of Y by sets open in Y, making it an open cover of Y. Since we assumed Y is compact, we have that there exists a finite subcover
\{A_{\alpha_1} \cap Y, \dots, A_{\alpha_n} \cap Y\}.
Then \{A_{\alpha_1}, \dots, A_{\alpha_n}\} is a finite subcover of Y by sets open in X.
(\rightarrow) Suppose every cover of Y by open sets in X has a finite subcover. Let \mathscr{B} = \{B_{\alpha}\}_{\alpha \in I} be an open cover of Y. Then, for each \alpha \in J, choose a set A_\alpha open in X such that
A_\alpha = B_\alpha \cap Y.
(To-DO: Prove such a set exists) Then the collection \mathscr{A} = \{A_\alpha\}_{\alpha \in I}. is a cover of Y by sets open in X. Thus there exists a finite subcover \{A_{\alpha_1}, \dots, A_{\alpha_n}\}. Then \{B_{\alpha_1}, \dots, B_{\alpha_n}\} is a finite subcover of Y, and Y is compact.